/*
 * Achieve it All! - Android app to motivate achieving your goals
 * Copyright (C) 2014  Xilconic
 * 
 * This file is part of Achieve it All!.
 *
 * Achieve it All! is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Achieve it All! is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Achieve it All!.  If not, see <http://www.gnu.org/licenses/>
 */
package com.xilconic.achieveitall.persist;

/**
 * Represents a database column definition, used during table creation.
 * @author Xilconic
 *
 */
public class ColumnTableDefinition {
	private String columnName;
	private SqliteDataType dataType;
	/**
	 * Create a new column table definition.
	 * @param columnName Name of the column.
	 * @param dataType Data type of the column.
	 */
	public ColumnTableDefinition(String columnName, SqliteDataType dataType) {
		this.columnName = columnName;
		this.dataType = dataType;
	}

	/**
	 * Gets the name of the column.
	 * @return The column name.
	 */
	public String getName() {
		return columnName;
	}
	
	/**
	 * Sets the name of the column.
	 * @param newName The new column name.
	 */
	public void setName(String newName) {
		columnName = newName;
	}

	/**
	 * Gets the data type of the column.
	 * @return The data type.
	 */
	public SqliteDataType getDataType() {
		return dataType;
	}
	
	/**
	 * Sets the data type of the column.
	 * @param newDataType The new data type.
	 */
	public void setDataType(SqliteDataType newDataType) {
		dataType = newDataType;
	}
	
	@Override
	public String toString(){
		return columnName.toString() + " " + dataType.toString();
		
	}
}
